/**
 * RegisterConfig.java 2020/5/8 8:27 下午 Copyright ©2020 www.bmsoft.com.cn All rights reserved.
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package configcenter.zookeeper.primary;


import java.util.Objects;

/**
 * File：RegisterConfig.java<br>
 * Title: <br>
 * Description: <br>
 * Company: www.treefinance.com.cn <br>
 * @author heyouchi
 * Date: 2020/5/8
 */
public class RegisterConfig {

  private String connectString;
  private String service;
  private String env;
  private int registerPort;
  private int weight;
  private String server;

  public RegisterConfig(String connectString, String service, String env, int registerPort, int weight,
      String server) {
    this.connectString = connectString;
    this.service = service;
    this.env = env;
    this.registerPort = registerPort;
    this.weight = weight;
    this.server = server;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RegisterConfig that = (RegisterConfig) o;
    return registerPort == that.registerPort &&
        weight == that.weight &&
        Objects.equals(connectString, that.connectString) &&
        Objects.equals(service, that.service) &&
        Objects.equals(env, that.env) &&
        Objects.equals(server, that.server);
  }

  @Override
  public int hashCode() {
    return Objects.hash(connectString, service, env, registerPort, weight, server);
  }

  public String getConnectString() {
    return connectString;
  }

  public void setConnectString(String connectString) {
    this.connectString = connectString;
  }

  public String getService() {
    return service;
  }

  public void setService(String service) {
    this.service = service;
  }

  public String getEnv() {
    return env;
  }

  public void setEnv(String env) {
    this.env = env;
  }

  public int getRegisterPort() {
    return registerPort;
  }

  public void setRegisterPort(int registerPort) {
    this.registerPort = registerPort;
  }

  public int getWeight() {
    return weight;
  }

  public void setWeight(int weight) {
    this.weight = weight;
  }

  public String getServer() {
    return server;
  }

  public void setServer(String server) {
    this.server = server;
  }

  @Override
  public String toString() {
    return "RegisterConfig{" +
        "connectString='" + connectString + '\'' +
        ", service='" + service + '\'' +
        ", env='" + env + '\'' +
        ", registerPort=" + registerPort +
        ", weight=" + weight +
        ", server='" + server + '\'' +
        '}';
  }
}
